Skip to content

fix: force full sync database snapshots#590

Open
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-force-sync-snapshot
Open

fix: force full sync database snapshots#590
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-force-sync-snapshot

Conversation

@codedogQBY

Copy link
Copy Markdown
Owner

Summary

  • Add a forceUploadSnapshot option to the simple sync database layer
  • Make upload-direction syncs force-upload a fresh full device snapshot, not just all book/cover files
  • Keep force-download receive-only semantics unchanged

Analysis

Issues #586 and #587 report the same cross-device flow: PC performs full upload, then Android performs full download, but the mobile data is not the latest. The file layer already had force-upload/force-download options, but the database snapshot layer could skip rewriting this device's remote snapshot when last_sync_at made incremental changes look empty and the existing remote snapshot was recent. In that case, a full upload could refresh files while leaving metadata/progress/library snapshot stale.

Verification

  • PASS git diff --check
  • PASS biome check packages/core/src/stores/sync-store.ts packages/core/src/stores/sync-store.test.ts packages/core/src/sync/simple-sync.ts packages/core/src/sync/__tests__/simple-sync.integration.test.ts
  • PASS PATH=/Users/bealqiu/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH packages/core/node_modules/.bin/vitest run packages/core/src/stores/sync-store.test.ts
  • PASS PATH=/Users/bealqiu/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH packages/core/node_modules/.bin/vitest run packages/core/src/sync/__tests__/simple-sync.integration.test.ts

Fixes #586
Fixes #587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant